﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace ZhiAo.CoreLibrary
{
    public class SqlServerUtility : IDBUtility
    {
        public string SQLQ(DateTime key)
        {
            return "'" + key.ToString("yyyy-MM-dd HH:mm:ss") + "'";
        }
 
        public string SqlQToChar(string key)
        {
            return "CONVERT(varchar, " + key + ", 120 )";
        }


        public string SqlQToChar(string key, string format)
        {
            if (format == "")
                return SqlQToChar(key);
            return "CONVERT(varchar," + key + ", " + format + " )";
        }


        public string SqlPlusMark()
        {
            return "+";
        }
    }
}
